package com.sino.dao.hibernate;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.sino.bean.TblZhuanjialinxuanjieguo;
import com.sino.bean.TblZhuanjiarukuxinxibiao;
import com.sino.dao.IExpertCommentDAO;

public class ExpertCommentDAO extends HibernateDaoSupport implements IExpertCommentDAO {





	public TblZhuanjialinxuanjieguo findExpertCommentById(String id) {
	  return (TblZhuanjialinxuanjieguo)this.getHibernateTemplate().get(TblZhuanjialinxuanjieguo.class, Integer.valueOf(id));
	}


	public List findExpertComments(String id) {
		String strSQL="from TblZhuanjialinxuanjieguo as  tzjlx where tzjlx.basicinfo.zlid=? order by pid";
		return this.getHibernateTemplate().find(strSQL,id);
	}


	public List findExpertsByZlid(String id) {
		String strSQL = "from TblZhuanjiayuxiangmuguanxi as tzx where  tzx..basicinfo.zlid=?";
		return this.getHibernateTemplate().find(strSQL, id);
	}


	public TblZhuanjiarukuxinxibiao getExpertById(String id) {
		return (TblZhuanjiarukuxinxibiao) this.getHibernateTemplate().get(
				TblZhuanjiarukuxinxibiao.class, id);
	}



	public TblZhuanjiarukuxinxibiao getExpertByName(String name) {
		// TODO Auto-generated method stub
		return null;
	}

	

	public void saveExpertComment(TblZhuanjialinxuanjieguo tzjlxjg) {
		this.getHibernateTemplate().saveOrUpdate(tzjlxjg);
	}


	public void delComment(String id) {
		TblZhuanjialinxuanjieguo tzjlx=(TblZhuanjialinxuanjieguo)this.getHibernateTemplate().get(TblZhuanjialinxuanjieguo.class, Integer.valueOf(id));
	    this.getHibernateTemplate().delete(tzjlx);
	}

}
